type: object
properties:
  upstreamNameservers:
    type: array
    description: |
      A list of IP addresses of recursive DNS servers that CoreDNS will use to resolve external domains.

      By default, the `/etc/resolv.conf` list is used.
    items:
      type: string
      pattern: '^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}(:[0-9]{1,})?$'
  transportProtocolMode:
    type: string
    description: |
      The mode of the transport protocol for communicating with the upstream DNS server:
      - `PreferUDP` — UDP is used, even if the original request came over TCP. Note that if the DNS response from the upstream DNS server exceeds 512 bytes and has been truncated and marked with the TC bit ([RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035.html#section-4.2.1)), then it will be resent over TCP ([RFC 5966](https://datatracker.ietf.org/doc/html/rfc5966)). The request will not be resent over TCP if there are other UDP issues.
      - `ForceTCP` — Always uses TCP, even if the original request is over UDP.
      - `KeepOriginal` — Uses the same protocol (TCP or UDP) as the original request.
    enum: [PreferUDP, ForceTCP, KeepOriginal]
    default: PreferUDP
  hosts:
    description: |
      A static list of hosts similar to that of `/etc/hosts`.
    x-doc-required: false
    type: array
    items:
      type: object
      properties:
        domain:
          type: string
          pattern: '^[0-9a-zA-Z\.-]+$'
        ip:
          type: string
          pattern: '^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$'
  stubZones:
    x-examples:
    -
      - zone: example.com
        upstreamNameservers: ['8.8.8.8']
        cacheTTLSeconds: 3600
        transportProtocolMode: PreferUDP
    description: |
      A list of additional zones CoreDNS should be authoritative for.
    type: array
    default: []
    items:
      type: object
      required: ['zone', 'upstreamNameservers']
      properties:
        zone:
          description: |
            The CoreDNS zone.
          type: string
          pattern: '^[0-9a-zA-Z\.-]+$'
          x-doc-example: consul.local
        upstreamNameservers:
          mixLength: 1
          description: |
            A list of IP addresses of recursive DNS servers that CoreDNS will use to resolve domains in this zone.
          type: array
          items:
            type: string
            pattern: '^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}(:[0-9]{1,})?$'
        cacheTTLSeconds:
          type: integer
          default: 30
          minimum: 1
          maximum: 3600
          description: |
            Max TTL in seconds for NOERROR responses.
        transportProtocolMode:
          type: string
          description: |
            The mode of the transport protocol for communicating with the upstream DNS server:
            - `PreferUDP` — UDP is used, even if the original request came over TCP. Note that if the DNS response from the upstream DNS server exceeds 512 bytes and has been truncated and marked with the TC bit ([RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035.html#section-4.2.1)), then it will be resent over TCP ([RFC 5966](https://datatracker.ietf.org/doc/html/rfc5966)). The request will not be resent over TCP if there are other UDP issues.
            - `ForceTCP` — Always uses TCP, even if the original request is over UDP.
            - `KeepOriginal` — Uses the same protocol (TCP or UDP) as the original request.
          enum: [PreferUDP, ForceTCP, KeepOriginal]
          default: PreferUDP
  enableLogs:
    description: |
      Enable CoreDNS logging.
    type: boolean
    default: false
  clusterDomainAliases:
    description: |
      A list of cluster domain aliases; these are resolved on par with `global.discovery.clusterDomain`.

      **Please note:** the domain aliase must not match the domain used in the DNS name template in the [publicDomainTemplate](../../deckhouse-configure-global.html#parameters-modules-publicdomaintemplate) parameter.
    type: array
    items:
      type: string
      pattern: '^[0-9a-zA-Z\.-]+$'
